<?php
include '../c/config.php';
if (isset($_POST['name'])){
	$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
	if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
	
	$openid=@$_SESSION['openid'];
	$name=addslashes(trim($_POST['name']));
	$sex=addslashes(trim($_POST['sex']));
	$phone=addslashes(trim($_POST['phone']));
	$email=addslashes(trim($_POST['email']));
	$miaosu=addslashes(trim($_POST['msg']));
	$sql="insert into liuyan(openid,name,sex,phone,email,miaosu,createtime) values('".$openid."','".$name."','".$sex."','".$phone."','".$email."','".$miaosu."','".date("Y-m-d H:i:s")."')  ";
	$mysqli->query($sql);
	echo json_encode(array('status'=>'ok'));
}

?>